import http from "@/untils/http";

// 获取
export function GetArticle() {
  return http({
    url: "/posts",
  });
}
//发布
export function SendArticle(title, content, status) {
  return http({
    url: "/posts",
    method: "post",
    data: {
      title,
      content,
      status,
    },
  });
}

// 修改   id为文章id
export function EditArticle(id, title, content, status) {
  return http({
    url: "/posts/" + id,
    method: "patch",
    data: {
      title,
      content,
      status,
    },
  });
}

//删除
export function DelArticle(id) {
  return http({
    url: "/posts/" + id,
    method: "delete",
  });
}
